class AppVersionResponseModel {
  final int code;
  final Data data;

  AppVersionResponseModel({
    required this.code,
    required this.data,
  });

  factory AppVersionResponseModel.init() => AppVersionResponseModel(
        code: 400,
        data: Data.init(),
      );

  factory AppVersionResponseModel.fromJson(Map<String, dynamic> json) =>
      AppVersionResponseModel(
        code: json['code'] ?? 400,
        data: json['data'] == null ? Data.init() : Data.fromJson(json['data']),
      );
}

class Data {
  final String version;
  final String apkUrl;
  final String downloadUrl;
  final String prompt;
  final List<String> versionLists;

  Data(
      {required this.version,
      required this.apkUrl,
      required this.downloadUrl,
      required this.prompt,
      required this.versionLists});

  factory Data.init() => Data(
        version: '',
        apkUrl: '',
        downloadUrl: '',
        prompt: '',
        versionLists: [],
      );

  factory Data.fromJson(Map<String, dynamic> json) => Data(
        version: json['version'] ?? '',
        apkUrl: json['apk_url'] ?? '',
        downloadUrl: json['download_url'] ?? '',
        prompt: json['prompt'] ?? '',
        versionLists: json['version_lists'] == null ? [] : List<String>.from(json['version_lists'].map((x) => x)),
      );
}
